From: Florian Müllner Date: Tue, 20 Aug 2019 02:10:46 +0000 (+0200) Subject: magnifier: Simplify some code X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~811^2^2~72 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2546445884d7c01a35775df5b7e22de6f07a176d;p=gnome-shell.git magnifier: Simplify some code We don't need nested if blocks to set or unset the crosshairs' clip size. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731 --- diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index 9d3ad6473..73522586f 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -451,15 +451,11 @@ var Magnifier = class Magnifier { * @clip: Flag to indicate whether to clip the crosshairs. */ setCrosshairsClip(clip) { - if (clip) { - if (this._crossHairs) - this._crossHairs.setClip(CROSSHAIRS_CLIP_SIZE); - } else { - // Setting no clipping on crosshairs means a zero sized clip - // rectangle. - if (this._crossHairs) - this._crossHairs.setClip([0, 0]); - } + if (!this._crossHairs) + return; + + // Setting no clipping on crosshairs means a zero sized clip rectangle. + this._crossHairs.setClip(clip ? CROSSHAIRS_CLIP_SIZE : [0, 0]); } /**